package cn.lanca_ip.config;

import cn.lanca_ip.service.IpServiceImpl;
import cn.lanca_ip.service.IpTemplate;
import cn.lanca_ip.service.impl.IpPropertiesInterImpl;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * xxx
 */
@Configuration
@EnableConfigurationProperties(IpProperties.class) //开启自动配置
public class IpAutoConfiguration {

    @Bean
    public IpServiceImpl ipService() {
        return new IpServiceImpl();
    }


    @Bean
    IpTemplate ipTemplate() {
        // 直接定义template为class,然后注入
        return new IpPropertiesInterImpl();
    }

}
